#include "SceneObject.h"
#include "SceneNode.h"

namespace Nezha
{
	SceneObject::SceneObject(const _string& name)
		:ControlledObject(name)
		,mLod(0)
	{

	}

	RenderObject* SceneObject::getRenderObject()
	{
		return NULL;
	}

	SceneNode* SceneObject::getParentSceneNode()
	{
		return mBindedSceneNode ? mBindedSceneNode->getParentSceneNode() : NULL;
	}

	void SceneObject::_internalSetLod(u16 lod)
	{
		mLod = lod;
	}

	void SceneObject::bind2SceneNode(SceneNode* sn)
	{
		if(sn)
		{
			_onAttach(sn);
		}
		else
		{
			_onDetach();
		}

		mBindedSceneNode = sn;
	}

}//end namespace Nezha